<?xml version="1.0" encoding="windows-1252"?>

<!--
    Document   : atom.xsl
    Created on : October 15, 2009, 11:32 AM
    Author     : msowders
    Description:
        Convert a unidata xml file into an atom feed.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xsl:version="2.0">
    <xsl:output method="xml"/>
    <xsl:param name="title"/>
    <xsl:param name="resourceuri"/>
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
        <atom:feed>
            <atom:title><xsl:value-of select="$title"/></atom:title>
            <xsl:apply-templates select="/ROOT/child::*"/>
        </atom:feed>
    </xsl:template>

    <xsl:template match="/ROOT/child::node()">
         <atom:entry>
            <atom:title><xsl:apply-templates select="_ID"/></atom:title>
            <atom:link>
                <xsl:attribute name="href"><xsl:value-of select="$resourceuri"/>/<xsl:apply-templates select="_ID"/></xsl:attribute>
            </atom:link>
        </atom:entry>
    </xsl:template>
</xsl:stylesheet>
